package com.sunny.excel.util;

import lombok.Getter;

/**
 * @Author:shucq
 * @Description:
 * @Date 2019/10/29 9:51
 */
@Getter
public enum PrimitiveType {

    INT_TYPE(Integer.class, int.class),
    FLOAT_TYPE(Float.class, float.class),
    DOUBLE_TYPE(Double.class, double.class),
    BOOLEAN_TYPE(Boolean.class, boolean.class),
    LONG_TYPE(Long.class, long.class),

    ;
    private Class<?> wrapClassType;

    private Class<?> primitiveType;

    PrimitiveType(Class wrapClassType, Class primitiveType) {
        this.wrapClassType = wrapClassType;
        this.primitiveType = primitiveType;
    }
    public static boolean isWrap(Class<?> clazz) {
        for (PrimitiveType type : PrimitiveType.values()) {
            if (type.getWrapClassType().equals(clazz)) {
               return true;
            }
        }
       return false;
    }
}